﻿using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Login.Web.Controllers
{
    [Authorize]
    public class BaseController : Controller
    {
        protected Logger Log { get; private set; }

        protected BaseController()
        {
            Log = LogManager.GetLogger(GetType().FullName);
        }

        protected override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            var route = RouteData;
            var controller = route.Values["controller"];
            var action = route.Values["action"];
            Log.Log(LogLevel.Info, "Action End," + controller + "," + action);
            base.OnActionExecuted(filterContext);
        }
    }
}